<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2><notempty name="info['attr_id']">编辑<else/>新增</notempty>商品类型属性</h2>
    </div>
    <form action="{:U()}" method="post" class="form-horizontal">
        <div class="form-item">
            <label class="item-label">属性名称:<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="attrname" value="{$info.attr_name}">
            </div>
        </div>
        <div class="form-item ">
            <label class="item-label">所属商品类型</label>
            <div class="controls">
                <label class="select">
                    <select name="goodstype">
                        <volist name="typelist" id="type">
                        <option value="{$type['cat_id']}" <eq name="type['cat_id']" value="$typeid">selected</eq>>
                            {$type.cat_name}
                        </option>
                        </volist>
                    </select>
                </label>
             
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label">能否进行检索</label>
            <div class="controls">
                <label class="radio">
                    <input type="radio" class="" name="issearch" value="0" <eq name="info['attr_index']" value="0">checked</eq>> 不需要检索
                <label class="radio">
                    <input type="radio" class=" " name="issearch" <eq name="info['attr_index']" value="1">checked</eq> value="1"> 关键字检索
                </label>
                <label class="radio">
                    <input type="radio" class=" " name="issearch" <eq name="info['attr_index']" value="2">checked</eq> value="2"> 范围检索
                </label>
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label">相同属性值商品是否关联？{$info['is_linked']}</label>
            <div class="controls">
                <label class="radio">
                    <input type="radio" class="" name="isjoin" value="0" <eq name="info['is_linked']" value="0">checked</eq>> 否
                </label>
                <label class="radio">
                    <input type="radio" class=" " name="isjoin" <eq name="info['is_linked']" value="1">checked</eq> value="1"> 是
                </label>
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label">属性是否可选？{$info['attr_type']}</label>
            <div class="controls">
                <label class="radio">
                    <input type="radio" class="" name="isselect"  <eq name="info['attr_type']" value="0">checked</eq> value="0"> 唯一属性
                </label>
                <label class="radio">
                    <input type="radio" class=" " name="isselect" <eq name="info['attr_type']" value="1">checked</eq>  value="1"> 单选属性
                </label>
                <label class="radio">
                    <input type="radio" class=" " name="isselect" <eq name="info['attr_type']" value="2">checked</eq> value="2"> 复选属性
                </label>
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label">属性值的录入方式</label>
            <div class="controls">
                <label class="radio">
                    <input type="radio" class="" name="inputway" value="0" <eq name="info['attr_input_type']" value="0">checked</eq>> 单行文本（text）
                </label>
                <label class="radio">
                    <input type="radio" class=" " name="inputway" <eq name="info['attr_input_type']" value="1">checked</eq> value="1"> 可选列表 （select）
                </label>
                <label class="radio">
                    <input type="radio" class=" " name="inputway" <eq name="info['attr_input_type']" value="2">checked</eq> value="2"> 多行文本（textarea）
                </label>
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">可选值列表</label>
            <div class="controls">
                <textarea name="inputtext" cols="40" rows="5" disabled="disabled">{$info['attr_values']}</textarea>
            </div>
        </div>
        <div class="form-item">
            <notempty name="typeid"><input type="hidden" name="typeid" value="{$typeid}"/></notempty>
            <notempty name="info.attr_id"><input type="hidden" name="aid" value="{$info.attr_id}"/></notempty>
            <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn submit-btn" id="reset" type="reset" onclick="javascript:this.form.reset();">重 置</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        $("input[name='inputway']").click(function(){
           
            iv=this.value;
            if(iv==1){
                $('textarea[name=inputtext]').attr('disabled','enabled').css('background','#ffffff');
            }else{
                 $('textarea[name=inputtext]').attr('disabled','disabled').css('background','#cccccc');
            }
        });
        //导航高亮
        highlight_subnav('{:U('User/index')}');
    </script>
</block>
